feat(django): Add failed_request_status_codes - #7140
Open
mgaligniana wants to merge 1 commit into
Open
Conversation
ericapisani
requested changes
Aug 10, 2026
ericapisani
left a comment
Member
There was a problem hiding this comment.
Thanks for opening this PR @mgaligniana , we really appreciate you taking the time to do so!
Overall the changes are looking great. However, I don't think we can exclude the 5xx codes from the failed_request_status_codes (left a more detailed comment below) and we'll need to address that before we can merge.
Don't hesitate to reach out with any questions!
|
|
||
|
|
||
| def _capture_exception( | ||
| exc_info: "Any", |
Member
There was a problem hiding this comment.
We can tighten this typing a bit by copying what we do within the event_from_exception method that's being invoked within this function:
Suggested change
| exc_info: "Any", | |
| exc_info: "Union[BaseException, ExcInfo]", |
This requires updating the import from sentry_sdk._types at the top to import ExcInfo:
from sentry_sdk._types import (
Event,
EventProcessor,
ExcInfo,
Hint,
NotImplementedType,
)
mgaligniana
force-pushed
the
GH-3134-add-failed-request-status-code-for-django
branch
from
August 12, 2026 12:43
44db0ad to
805023b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Hi! In this PR I've added
failed_request_status_codeto the Django integrationSince English isn't my first language, I tried to keep the comments as simple and clear as possible, so they're easy to understand even for beginners like me who don't know the full Sentry product. Feel free to make any changes or suggestions!
Issues
failed_request_status_codesfor more web frameworks #3134